<style type="text/css">
	.page-header .left{
		width: calc(100% - 220px);
	}
	@media only screen and (max-width: 479px) and (min-width: 320px) {
		.page-header .left{
			width: 100%;
		}
	}
</style>
<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['设备安装管理','安装管理[个人]','安装车辆']" icon="fa fa-wrench" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>安装车辆</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<!-- <div class="top_module">
									<span class="module_text">公司名称</span>
									<sa-company-tree companyTreeId="companyTree" [companyIdValue]="companyData.companyId" [companyNameValue]="companyData.companyName" (companySelected)="companySelected($event)"></sa-company-tree>                     
								</div>  -->
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">车辆用途</span>
									<select name="" class="top_module_select" [(ngModel)]="useTypeL1" (change)='carUseTypeL1Change()'>
										<option value="">全部</option>
										<option value="" *ngFor="let item of carTypeList" [value]="item.id">{{item.label}}</option>
									</select>
								</div>
								<!-- <div class="top_module top_module_box">
									<span class="top_module_label module_text">车辆分类</span>
									<select name="" class="top_module_select" [(ngModel)]="useTypeL2">
										<option value="">全部</option>
										<option value="" *ngFor="let item of carTypeDetailList" [value]="item.id">{{item.label}}</option>
									</select>
								</div> -->
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)" [specifyTime]='initDateRange'></table-select-date>
								</div>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">传感器类型</span>
									<sa-sensor-type (sensorSelected)="sensorSelected($event)" [inputParam]="inputParam" Height="28px" [isShow]='true' type='1' [isSendRequest]='false'></sa-sensor-type>
								</div>
								
								<button class="btn btn-primary" (click)="table_search()">查询</button>
								<!-- <button  type="button"  class="btn btn-primary" (click)="new_car()" *ngIf='carAdd'>添加</button> -->
								<button class="btn btn-primary"  type="button" (click)="exprotData()" >导出</button>
								<!-- <button type="button" class="btn btn-primary" (click)="setHeader(headerModal)">设置表头</button> -->
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="设备ID、车牌号、录入人员...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>图片</th>
										<th>车牌号</th>
										<th>设备ID</th>
										<th>所属公司</th>
										<th>用途分类</th>
										<th>传感器通道</th>
										<th>录入人员</th>
										<th>安装时间</th>
										<th>司机电话</th>
										<th>曾用车牌</th>
										<th>备注</th>
										<th>传感器问题</th>
										<th>GPS问题</th>
										<th>GPS天线</th>
										<th>GSM天线</th>
										<th>硬件版本</th>
                                        <th>固件版本</th>
                                        <th>传感器类型</th>
										<th>SIM卡号</th>
										<th>GPS编码</th>
										<th>车辆类型</th>
										<th>用途</th>
										<th>轴数</th>
										<th>传感器数量</th>
										<th>荷载重量</th>
										<th>单位</th>
										<th>更新人</th>
										<th>更新时间</th>
										
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
									    <td>
                                            <!-- <button type="button" (click)="updata_car(row)" *ngIf='carEdit'>编辑</button> -->
                                            <button type="button" (click)="open_img(row,ImgModal)" *ngIf="row.imageInfo != null && row.imageInfo.length !=0">图片</button>
										</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.deviceId}}</td>
										<td>{{row.parentName}}</td>
										<td>{{row.useTypeL2}}</td>
										<td>
                                            <span  class="channel-style bg-green" *ngFor="let item of row.sensorChannel">{{item}}</span>
                                        </td>
										<td>{{row.userNameForCreate}}</td>
										<td>{{row.inputDate}}</td>
										<td>{{row.driverName}} {{row.phone}}</td>
										<td>{{row.usedNumbers}}</td>
										<td>{{row.remark}}</td>
										<td>
                                            <div *ngIf="row.sensorProblemList">
                                                <span *ngFor="let item of row.sensorProblemList,let i = index">{{item.sensorProblem}}<span *ngIf="i < row.sensorProblemList.length - 1">,</span></span>
                                            </div>
                                        </td>
										<td>
                                            {{row.gpsProblemEntity?row.gpsProblemEntity.gpsProblem : ''}}
                                        </td>
										<td>{{row.gpsAntenna}}</td>
										<td>{{row.gsmAntenna}}</td>
										<td>{{row.hwVersion}}</td>
										<td>{{row.fwVersion}}</td>
										<td>
											<sa-sensor-type [sensorTypeId]="row.sensorType" type='2' [inputParam]="inputParam" [isSendRequest]='false'></sa-sensor-type>
                                        </td>
                                        <td>{{row.sim}}</td>
                                        <td>{{row.gpsId}}</td>
                                        <td>
                                            <span *ngIf="row.carType === '请选择'"> </span>
                                            <span *ngIf="row.carType != '请选择'">{{row.carType}}</span>
										</td>
										<td>{{row.useTypeL1}}</td>
                                        <td>{{row.carAxleAmount}}</td>
                                        <td>{{row.sensorAmount}}</td>
										<td>{{row.loadCapacity}}</td>
										<td>
                                            <span *ngIf="row.unit === '1'">吨</span>
                                            <span *ngIf="row.unit === '2'">千克</span>
                                        </td>
										<td>{{row.userNameForUpdate}}</td>
										<td>{{row.updateDate}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!-- 图片查看   弹窗-->
	<section bsModal #ImgModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg" style="width: 1000px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="imgClose(ImgModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
					<h4 class="modal-title">图片<span *ngIf='modal.carNumber'>-[{{modal.carNumber}}]</span></h4>
				</div>
				<div class="modal-body" style="padding: 0 20px 20px 20px">
					<div class="row form-horizontal imagesInfo" *ngIf='imgInfo.length != 0'>
						<!-- <div class="imagesList" >
							<div *ngFor="let item of imgInfo" class="imagesList-cont">
								<div class="imgList" *ngIf='item.index == 1'>
									<label class="imgTitle">车辆正面</label>
									<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
										<img class="imgSrc" [src]="row" alt="车辆正面"/>
									</div>
								</div>
								<div class="imgList" *ngIf='item.index == 2'>
									<label class="imgTitle">车辆侧面</label>
									<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
										<img class="imgSrc" [src]="row" alt="车辆侧面"/>
									</div>
								</div>
								<div class="imgList" *ngIf='item.index == 3'>
									<label class="imgTitle">主机</label>
									<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
										<img class="imgSrc" [src]="row" alt="主机"/>
									</div>
								</div>
								<div class="imgList" *ngIf='item.index == 5'>
									<label class="imgTitle">天线</label>
									<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
										<img class="imgSrc" [src]="row" alt="天线"/>
									</div>
								</div>
								<div class="imgList" *ngIf='item.index == 4' style="display: none;"></div>
								<div class="imgList" *ngIf='item.index == 6' style="display: none;"></div>
								<div class="imgList" *ngIf='item.index == 7' style="display: none;"></div>
							</div>
						</div> -->
						<div class="imagesList imagesList-sensor">
							<div *ngFor="let item of imgInfo">
								<div class="imgFileList" *ngIf='item.index == 1'>
									<label class="imgTitle">车辆正面</label>
									<div class="imgContList">
										<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
											<img class="imgSrc" [src]="row" alt="车辆正面"/>
										</div>
									</div>
								</div>
								<div class="imgFileList" *ngIf='item.index != 1' style="display: none;"></div>
							</div>
						</div>
						<div class="imagesList imagesList-sensor">
							<div *ngFor="let item of imgInfo">
								<div class="imgFileList" *ngIf='item.index == 2'>
									<label class="imgTitle">车辆侧面</label>
									<div class="imgContList">
										<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
											<img class="imgSrc" [src]="row" alt="车辆侧面"/>
										</div>
									</div>
								</div>
								<div class="imgFileList" *ngIf='item.index != 2' style="display: none;"></div>
							</div>
						</div>
						<div class="imagesList imagesList-sensor">
							<div *ngFor="let item of imgInfo">
								<div class="imgFileList" *ngIf='item.index == 3'>
									<label class="imgTitle">主机</label>
									<div class="imgContList">
										<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
											<img class="imgSrc" [src]="row" alt="主机"/>
										</div>
									</div>
								</div>
								<div class="imgFileList" *ngIf='item.index != 3' style="display: none;"></div>
							</div>
						</div>
						<div class="imagesList imagesList-sensor">
							<div *ngFor="let item of imgInfo">
								<div class="imgFileList" *ngIf='item.index == 5'>
									<label class="imgTitle">天线</label>
									<div class="imgContList">
										<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
											<img class="imgSrc" [src]="row" alt="天线"/>
										</div>
									</div>
								</div>
								<div class="imgFileList" *ngIf='item.index != 5' style="display: none;"></div>
							</div>
						</div>
						<div class="imagesList imagesList-sensor">
							<div *ngFor="let item of imgInfo">
								<div class="imgFileList" *ngIf='item.index == 4'>
									<label class="imgTitle">传感器</label>
									<div class="imgContList">
										<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
											<img class="imgSrc" [src]="row" alt="传感器"/>
										</div>
									</div>
								</div>
								<div class="imgFileList" *ngIf='item.index != 4' style="display: none;"></div>
							</div>
						</div>
						<div class="imagesList imagesList-sensor">
							<div *ngFor="let item of imgInfo">
								<div class="imgFileList" *ngIf='item.index == 7'>
									<label class="imgTitle">电源</label>
									<div class="imgContList">
										<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
											<img class="imgSrc" [src]="row" alt="电源"/>
										</div>
									</div>
								</div>
								<div class="imgFileList" *ngIf='item.index != 7' style="display: none;"></div>
							</div>
						</div>
						<div class="imagesList imagesList-other">
							<div *ngFor="let item of imgInfo">
								<div class="imgFileList" *ngIf='item.index == 6'>
									<label class="imgTitle">其他</label>
									<div class="imgContList">
										<div class="imgCont" *ngFor="let row of item.localImg" (click)="bigimg(ImgBigModal,row)">
											<img class="imgSrc" [src]="row" alt="其他"/>
										</div>
									</div>
								</div>
								<div class="imgFileList" *ngIf='item.index != 6' style="display: none;"></div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>
	<!-- 图片查看 弹窗end-->
	<!-- 图片放大查看   弹窗-->
	<section bsModal #ImgBigModal="bs-modal" class="modal fade imgView" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<!-- <div class="closeImg" (click)="CloseBigImg(ImgBigModal)"></div> -->
		<div class="modal-content modal-imgContent" (click)="CloseBigImg(ImgBigModal)" >
			<img [src]="bigImg" />
		</div>
	</section>
	<!-- 图片放大查看 弹窗end-->
</div>
<style type="text/css">
	.picture{
		min-height: 100px;
		width: 100%;
		height: auto;
	}


		/* 表头管理弹窗样式 */
.CBtn{
	text-align: center;
}
.CBtn span{
    padding: 5px 8px;
    margin-right: 10px;
    font-size: 12px;
    border-radius: 5px;
	color: #fff;
	cursor: -webkit-grab;
}
.CBtn .MoveUp{
	color: #da3120;
	border: 1px solid #da3120;
	background: #fff;
	/* background: #da3120ba; */
}
.CBtn .MoveUp:hover{
	background: #da3120;
	color: #fff;
}
.CBtn .MoveDown{
	color: #4CAF50;
    border: 1px solid #4CAF50;
	background: #fff;
}
.CBtn .MoveDown:hover{
	background: #4CAF50;;
	color: #fff;
}
.CBtn .MoveTop{
	/* background: #ac20daba; */
	color: #ac20da;
	border: 1px solid #ac20da;
	background: #fff;
}
.CBtn .MoveTop:hover{
	background: #ac20da;
	color: #fff;
}
.CBtn .MoveBottom{
	/* background: #20afdaba; */
	color: #20afda;
	border: 1px solid #20afda;
	background: #fff;
}
.CBtn .MoveBottom:hover{
	background: #20afda;
	color: #fff;
}
.CBtn .hiddenMove{
	background: #d4d4d4 !important;
	cursor: not-allowed;
	border: 1px solid #d4d4d4 !important;
	color: #fff;
}
</style>